package com.jiangds.open.check.checker;

import com.jiangds.open.check.Checker;

/**
 * {@link IntegerChecker}  整形校验类
 *
 * @author jiangliang
 * @since 2021/1/5 16:00
 */
public class IntegerChecker extends AbstractChecker<Integer,Integer> {


    public IntegerChecker(Integer target) {
        super(target);
    }

    @Override
    public Checker<Integer, Integer> notEmpty() {
        return notNull();
    }

    @Override
    public Checker<Integer, Integer> range(Integer min, Integer max) {
        return integerRangeProcessor(t->t,min,max);
    }

    @Override
    public Checker<Integer, Integer> greater(Integer greaterThan) {
        return processor(t->t >= greaterThan);
    }

    @Override
    public Checker<Integer, Integer> less(Integer lessThan) {
       return processor(t-> t <= lessThan);
    }

    @Override
    public Checker<Integer, Integer> in(Integer... args) {
        return inProcessor(Integer::equals,args);
    }

}
